package com.xyw.his00.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xyw.his00.dto.DepartmentDTO;
import com.xyw.his00.pojo.dbpojo.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper extends BaseMapper<Employee> {

    @Select("SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM employee " +
            "WHERE realname=#{username} AND password=#{password} AND deptment_id=#{deptId}")
    //大于0则有该账户
    public int login(String username,String password,Integer deptId);



    public List<DepartmentDTO> getDeptIdAndNames();


}
